import pyvisa as visa
 
visa_dll = 'C:/Windows/System32/visa32.dll'
tcp_addr = 'TCPIP0::127.0.0.1::5025::SOCKET'
rm = visa.ResourceManager(visa_dll)
tcp_inst = rm.open_resource(tcp_addr)
tcp_inst.read_termination = '\n'
print(tcp_inst.query('*IDN?\n')) 
